package com.cc.model.convert

import com.cc.model.Log
import com.cc.model.dto.ext.LogDto
import org.mapstruct.*

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING)
abstract class LogConvert {

    abstract fun toEntity(logDto: LogDto): Log

    abstract fun toDto(log: Log): LogDto

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    abstract fun partialUpdate(logDto: LogDto, @MappingTarget log: Log): Log
}